package com.e3.basdoc.region.client;

import com.e3.basdoc.region.model.RegionModel;
import com.e3.template.tgf.TGFEditorDialog;
import com.e3.template.tgf.TGFSimpleFormPanel;
import com.e3.web.core.client.GwtAsyncCallback;

public class RegionEditorDialog extends TGFEditorDialog<RegionModel> {
	
	private RegionRPCServiceAsync service = RegionRPCService.Util.getInstance();

	@Override
	public TGFSimpleFormPanel<RegionModel> createFormPanel() {
		return new RegionFormPanel();
	}

	@Override
	public void executeNewService(RegionModel model, GwtAsyncCallback<RegionModel> callback) {
		service.newRegion(model, callback);
	}

	@Override
	public void executeModifyService(RegionModel model, GwtAsyncCallback<RegionModel> callback) {
		service.modifyRegion(model, callback);
	}

	@Override
	public String[] getNotNullFieldNames() {
		return RegionHelper.INSTANCE.getNotNullFieldNames();
	}

}
